/**
 * 路径分析
 * @author cqb
 * @class OpenLayers.Control.BufferLineAnalysis
 * @extends OpenLayers.Control
 * @version 1.0
 * @requires extend/Control/BufferPointAnalysis.js
 */

OpenLayers.Control.BufferLineAnalysis = OpenLayers.Class(OpenLayers.Control.BufferPointAnalysis,{
	/**
	 * Property: title {String} 工具按钮提示文字
	 */
	title : "线缓冲分析",
	

	/**
	 * Method: activate 控件被触发时设置鼠标手势
	 */
	activate : function() {
		OpenLayers.Control.BufferPointAnalysis.prototype.activate.apply(this,arguments);
        this.map.layerContainerDiv.style.cursor = "url("
				+ OpenLayers.Util.getRootPath()
				+ "img/bufferline.cur),default";
	},

	/**
	 * Method: draw
	 */
	draw : function() {
        var symbolizers = {
            "Point": {
                pointRadius: 0,
                fillOpacity: 0,
                strokeWidth: 0,
                strokeOpacity: 0
            }
        };
        var style = new OpenLayers.Style();
        style.addRules([
        new OpenLayers.Rule({symbolizer: symbolizers})]);
        
        var styleMap = new OpenLayers.StyleMap({"default": style});

		this.handler = new OpenLayers.Handler.Path(this, {
			done : this.bufferQuery
		},{
			layerOptions: {
				styleMap: styleMap
			}
		});
        
        var modifyFeature = this.handler.modifyFeature;
		var scope = this;
		this.handler.modifyFeature = function(pixel, drawing){
            modifyFeature.apply(scope.handler, arguments);
            scope.map.layerContainerDiv.style.cursor = "url("+OpenLayers.Util.getRootPath() + "img/bufferline.cur),default";
		}
	},
	
	CLASS_NAME : "OpenLayers.Control.BufferLineAnalysis"
});